import * as types from '../actions/actionTypes';

const initialState = {
    'validateCode' : '',
    'loading' : false,
    'res' : {},
};

let registerReducer = (state = initialState, action) => {

     switch(action.type)
     {
        case types.FETCH_VALIDATE_CODE :
            return {
                 ...state,
            }
        case types.RECEIVE_VALIDATE_CODE :
            return Object.assign({}, state, {
                'validateCode' : action.validateCode,
            })
        case types.SEND_MESSAGE_MOBILE :
            return Object.assign({}, state, {
                'loading' : action.loading,
            })
        case types.RECEIVE_MESSAGE_MOBILE :
            return Object.assign({}, state, {
                'res' : action.res,
                'loading' : action.loading,
            })
         default : 
             return state;
     }
}

export default registerReducer;